<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- 
<script type="text/javascript" src="js/jquery-1.11.1.min.js"></script>
<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
 -->
<script type="text/javascript" src="js/jquery/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="js/bootstrap/bootstrap-3.3.7.min.js"></script>
<script type="text/javascript" src="js/sweetalert.min.js"></script>
s
<link rel="stylesheet" href="css/bootstrap/bootstrap.min.css">
<link rel="stylesheet" href="css/sweetalert.css">
<title>Insert title here</title>
</head>
<body>

	<div class="btn-group" id="color" data-toggle="buttons">
		<label class="btn btn-default"> <input type="radio"
			class="toggle" value="1"> 红色
		</label> <label class="btn btn-default"> <input type="radio"
			class="toggle" value="2"> 绿色
		</label> <label class="btn btn-default"> <input type="radio"
			class="toggle" value="3"> 蓝色
		</label>
	</div>

	<script>
		$(function() {
			$('#color').on('click', new function() {

				var selectedColor = $('#color input:radio:checked').val();
				console.log(selectedColor);
				alert(selectedColor);
			})
		})
	</script>


</body>
</html>